#! /bin/sh

p2=6
p1=6
size=64
infile=xy.dat

unisam verbose=1 nout=$size xin=0,12,51,63 yin=0,0,0,0 \
        nsint=1 amp=-0.3 isint=1 nwidth=4> x.dat

farith verbose=1 in=x.dat n=$size op=cartprod in2=x.dat \
	> $infile

reconfile=recon.dat
mrafile=mra.dat
dfile=d.dat

mrafxzwt verbose=1 order=4 p2=$p2 p1=$p1 \
	n1=$size n2=$size mralevel2=3 mralevel1=3 \
	< $infile >$mrafile reconfile=$reconfile \
	dfile=$dfile recon=0 
  
psimage n1=$size n2=$size title="Original Model" \
	style=normal < $infile \
	>original.eps 

psimage n1=$size n2=$size title="MRA of the Model" \
	< $mrafile \
	>mra.eps

psimage n1=$size n2=$size title="Reconstructed Model" style=normal \
	< $reconfile \
	>recon.eps

psimage n1=$size n2=$size title="Difference" style=normal \
	< $dfile \
	>dif.eps

echo ""
echo "You may now view the files:    original.eps, mra.eps, recon.eps, dif.eps"
echo "with your PostScript Previewer"

exit 0
